<!DOCTYPE html>
<html>
<head>
	<title>编辑-选择年月</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="yes" name="apple-touch-fullscreen">
	<meta content="telephone=no,email=no" name="format-detection">
	 <link rel="stylesheet" href="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/normalize.css" type="text/css">
	  <link rel="stylesheet" href="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/edit_time.css" type="text/css">
	  <script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/jquery-1.7.2.min.js"></script>
	 <script type="text/javascript">
		!function(a,b){function c(){var b=f.getBoundingClientRect().width;b/i>540&&(b=540*i);var c=b/10;f.style.fontSize=c+"px",k.rem=a.rem=c}var d,e=a.document,f=e.documentElement,g=e.querySelector('meta[name="viewport"]'),h=e.querySelector('meta[name="flexible"]'),i=0,j=0,k=b.flexible||(b.flexible={});if(g){console.warn("将根据已有的meta标签来设置缩放比例");var l=g.getAttribute("content").match(/initial\-scale=([\d\.]+)/);l&&(j=parseFloat(l[1]),i=parseInt(1/j))}else if(h){var m=h.getAttribute("content");if(m){var n=m.match(/initial\-dpr=([\d\.]+)/),o=m.match(/maximum\-dpr=([\d\.]+)/);n&&(i=parseFloat(n[1]),j=parseFloat((1/i).toFixed(2))),o&&(i=parseFloat(o[1]),j=parseFloat((1/i).toFixed(2)))}}if(!i&&!j){var p=(a.navigator.appVersion.match(/android/gi),a.navigator.appVersion.match(/iphone/gi)),q=a.devicePixelRatio;i=p?q>=3&&(!i||i>=3)?3:q>=2&&(!i||i>=2)?2:1:1,j=1/i}if(f.setAttribute("data-dpr",i),!g)if(g=e.createElement("meta"),g.setAttribute("name","viewport"),g.setAttribute("content","initial-scale="+j+", maximum-scale="+j+", minimum-scale="+j+", user-scalable=no"),f.firstElementChild)f.firstElementChild.appendChild(g);else{var r=e.createElement("div");r.appendChild(g),e.write(r.innerHTML)}a.addEventListener("resize",function(){clearTimeout(d),d=setTimeout(c,300)},!1),a.addEventListener("pageshow",function(a){a.persisted&&(clearTimeout(d),d=setTimeout(c,300))},!1),"complete"===e.readyState?e.body.style.fontSize=12*i+"px":e.addEventListener("DOMContentLoaded",function(){e.body.style.fontSize=12*i+"px"},!1),c(),k.dpr=a.dpr=i,k.refreshRem=c,k.rem2px=function(a){var b=parseFloat(a)*this.rem;return"string"==typeof a&&a.match(/rem$/)&&(b+="px"),b},k.px2rem=function(a){var b=parseFloat(a)/this.rem;return"string"==typeof a&&a.match(/px$/)&&(b+="rem"),b}}(window,window.lib||(window.lib={}));</script>
	<style type="text/css">

	</style>

</head>
<body>
	<div class="container">

		<div class="edit_initial">
			<div class="year_container">
				<div class="year_header">
					<div class="year_header_center">
						<div class="year_header_left">
							<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_restore_content_timeline_calendar_icon_nor.png" style="width:0.64rem;height:0.64rem;float:left;">
							<a style="display:inline-block;line-height:0.64rem;float:left;margin-left:0.133333rem;font-family: PingFangSC-Medium;font-size: 0.32rem;color: #646464;">选择年月</a>
						</div>
						<div class="year_header_right">{$yearmonth|reset}~{$yearmonth|end}</div>

					</div>
				</div>
				<div class="year_main">
					<foreach name="year" item="vo">
						<div class="year_main_center">
							<div class="year_main_header clear">
							<div class="year_main_left">{$vo.year}年</div>
							<div class="year_main_right" onclick="deleteyear('{$vo.year}')">点击删除整年</div>
						</div>
						<div class="year_ul">
							<ul class="clear">
								<if condition="in_array($vo['year'].'01',$cata)"><foreach name="Cata" item="vc"><if condition="$vc['createTime'] eq $vo['year'].'01'"><li class="have" onclick="getmonth(1,{$vc['count']},{$vc['createTime']},this)">1月</li></if></foreach>
									<elseif condition="in_array($vo['year'].'01',$Eata)"/><foreach name="eata" item="ve"><if condition="$ve['createTime'] eq $vo['year'].'01'"><li class="onhave" onclick="getmonth(2,{$ve['count']},{$ve['createTime']},this)">1月</li></if></foreach></if>
								<if condition="in_array($vo['year'].'02',$cata)"><foreach name="Cata" item="vc"><if condition="$vc['createTime'] eq $vo['year'].'02'"><li class="have" onclick="getmonth(1,{$vc['count']},{$vc['createTime']},this)">2月</li></if></foreach>
									<elseif condition="in_array($vo['year'].'02',$Eata)"/><foreach name="eata" item="ve"><if condition="$ve['createTime'] eq $vo['year'].'02'"><li class="onhave" onclick="getmonth(2,{$ve['count']},{$ve['createTime']},this)">2月</li></if></foreach></if>
								<if condition="in_array($vo['year'].'03',$cata)"><foreach name="Cata" item="vc"><if condition="$vc['createTime'] eq $vo['year'].'03'"><li class="have" onclick="getmonth(1,{$vc['count']},{$vc['createTime']},this)">3月</li></if></foreach>
									<elseif condition="in_array($vo['year'].'03',$Eata)"/><foreach name="eata" item="ve"><if condition="$ve['createTime'] eq $vo['year'].'03'"><li class="onhave" onclick="getmonth(2,{$ve['count']},{$ve['createTime']},this)">3月</li></if></foreach></if>
								<if condition="in_array($vo['year'].'04',$cata)"><foreach name="Cata" item="vc"><if condition="$vc['createTime'] eq $vo['year'].'04'"><li class="have" onclick="getmonth(1,{$vc['count']},{$vc['createTime']},this)">4月</li></if></foreach>
									<elseif condition="in_array($vo['year'].'04',$Eata)"/><foreach name="eata" item="ve"><if condition="$ve['createTime'] eq $vo['year'].'04'"><li class="onhave" onclick="getmonth(2,{$ve['count']},{$ve['createTime']},this)">4月</li></if></foreach></if>
								<if condition="in_array($vo['year'].'05',$cata)"><foreach name="Cata" item="vc"><if condition="$vc['createTime'] eq $vo['year'].'05'"><li class="have" onclick="getmonth(1,{$vc['count']},{$vc['createTime']},this)">5月</li></if></foreach>
									<elseif condition="in_array($vo['year'].'05',$Eata)"/><foreach name="eata" item="ve"><if condition="$ve['createTime'] eq $vo['year'].'05'"><li class="onhave" onclick="getmonth(2,{$ve['count']},{$ve['createTime']},this)">5月</li></if></foreach></if>
								<if condition="in_array($vo['year'].'06',$cata)"><foreach name="Cata" item="vc"><if condition="$vc['createTime'] eq $vo['year'].'06'"><li class="have" onclick="getmonth(1,{$vc['count']},{$vc['createTime']},this)">6月</li></if></foreach>
									<elseif condition="in_array($vo['year'].'06',$Eata)"/><foreach name="eata" item="ve"><if condition="$ve['createTime'] eq $vo['year'].'06'"><li class="onhave" onclick="getmonth(2,{$ve['count']},{$ve['createTime']},this)">6月</li></if></foreach></if>
								<if condition="in_array($vo['year'].'07',$cata)"><foreach name="Cata" item="vc"><if condition="$vc['createTime'] eq $vo['year'].'07'"><li class="have" onclick="getmonth(1,{$vc['count']},{$vc['createTime']},this)">7月</li></if></foreach>
									<elseif condition="in_array($vo['year'].'07',$Eata)"/><foreach name="eata" item="ve"><if condition="$ve['createTime'] eq $vo['year'].'07'"><li class="onhave" onclick="getmonth(2,{$ve['count']},{$ve['createTime']},this)">7月</li></if></foreach></if>
								<if condition="in_array($vo['year'].'08',$cata)"><foreach name="Cata" item="vc"><if condition="$vc['createTime'] eq $vo['year'].'08'"><li class="have" onclick="getmonth(1,{$vc['count']},{$vc['createTime']},this)">8月</li></if></foreach>
									<elseif condition="in_array($vo['year'].'08',$Eata)"/><foreach name="eata" item="ve"><if condition="$ve['createTime'] eq $vo['year'].'08'"><li class="onhave" onclick="getmonth(2,{$ve['count']},{$ve['createTime']},this)">8月</li></if></foreach></if>
								<if condition="in_array($vo['year'].'09',$cata)"><foreach name="Cata" item="vc"><if condition="$vc['createTime'] eq $vo['year'].'09'"><li class="have" onclick="getmonth(1,{$vc['count']},{$vc['createTime']},this)">9月</li></if></foreach>
									<elseif condition="in_array($vo['year'].'09',$Eata)"/><foreach name="eata" item="ve"><if condition="$ve['createTime'] eq $vo['year'].'09'"><li class="onhave" onclick="getmonth(2,{$ve['count']},{$ve['createTime']},this)">9月</li></if></foreach></if>
								<if condition="in_array($vo['year'].'10',$cata)"><foreach name="Cata" item="vc"><if condition="$vc['createTime'] eq $vo['year'].'10'"><li class="have" onclick="getmonth(1,{$vc['count']},{$vc['createTime']},this)">10月</li></if></foreach>
									<elseif condition="in_array($vo['year'].'10',$Eata)"/><foreach name="eata" item="ve"><if condition="$ve['createTime'] eq $vo['year'].'10'"><li class="onhave" onclick="getmonth(2,{$ve['count']},{$ve['createTime']},this)">10月</li></if></foreach></if>
								<if condition="in_array($vo['year'].'11',$cata)"><foreach name="Cata" item="vc"><if condition="$vc['createTime'] eq $vo['year'].'11'"><li class="have" onclick="getmonth(1,{$vc['count']},{$vc['createTime']},this)">11月</li></if></foreach>
									<elseif condition="in_array($vo['year'].'11',$Eata)"/><foreach name="eata" item="ve"><if condition="$ve['createTime'] eq $vo['year'].'11'"><li class="onhave" onclick="getmonth(2,{$ve['count']},{$ve['createTime']},this)">11月</li></if></foreach></if>
								<if condition="in_array($vo['year'].'12',$cata)"><foreach name="Cata" item="vc"><if condition="$vc['createTime'] eq $vo['year'].'12'"><li class="have" onclick="getmonth(1,{$vc['count']},{$vc['createTime']},this)">12月</li></if></foreach>
									<elseif condition="in_array($vo['year'].'12',$Eata)"/><foreach name="eata" item="ve"><if condition="$ve['createTime'] eq $vo['year'].'12'"><li class="onhave" onclick="getmonth(2,{$ve['count']},{$ve['createTime']},this)">12月</li></if></foreach></if>
							</ul>
						</div>
					</div></foreach>
				</div>

		</div>
		<div class="regain_bot">
				<div class="regain_center">
					<div class="regain_left">
						<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/regain_back.png" style="width:100%;height:100%;">
					</div>
					<div class="regain_right" onclick="dump()">
						<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/regain_yes.png" style="width:100%;height:100%;">
					</div>
				</div>
			</div>

	</div>


</body>
	 <script type="text/javascript">

	 </script>

<script>

	function deleteyear(year)
	{
		console.log(year);
		$.ajax({
			type: "get",//数据发送的方式（post 或者 get）
			url: " {:U('WbBooks/deleteyear')}",//要发送的后台地址
			data:{'year':year},//要发送的数据（参数）格式为{'val1':"1","val2":"2"}
			dataType: "json",//后台处理后返回的数据格式
			success:function(data){
				alert(JSON.stringify(data))
				window.location.reload()
			}
		})
	};

</script>

<script>
	function getmonth(type,count,time,params){
		//当type为1时则为删除
		if(type==1){
			console.log(type,count,time);
			$.ajax({
				type: "get",//数据发送的方式（post 或者 get）
				url: " {:U('WbBooks/deletemonth')}",//要发送的后台地址
				data:{'time':time,'type':type,'count':count},//要发送的数据（参数）格式为{'val1':"1","val2":"2"}
				dataType: "json",//后台处理后返回的数据格式
				success:function(data){
//				alert(JSON.stringify(data))
					window.location.reload()
				}
			})
		}
		//当type为2时为恢复
		else{
			$.ajax({
				type: "get",//数据发送的方式（post 或者 get）
				url: " {:U('WbBooks/recovermonth')}",//要发送的后台地址
				data:{'time2':time,'type':type,'count':count},//要发送的数据（参数）格式为{'val1':"1","val2":"2"}
				dataType: "json",//后台处理后返回的数据格式
				success:function(data){
//				alert(JSON.stringify(data))
					window.location.reload()
				}
			})
		}
	}

	var WST = ThinkPHP = window.Think = {
		"ROOT"   : "__ROOT__",
		"APP"    : "__APP__",
		"PUBLIC" : "__PUBLIC__",
		"DEEP"   : "{:C('URL_PATHINFO_DEPR')}",
		"MODEL"  : ["{:C('URL_MODEL')}", "{:C('URL_CASE_INSENSITIVE')}", "{:C('URL_HTML_SUFFIX')}"],
		"VAR"    : ["{:C('VAR_MODULE')}", "{:C('VAR_CONTROLLER')}", "{:C('VAR_ACTION')}"],
		"DOMAIN" : "{:WSTDomain()}",
		"CITY_ID" : "{$currArea['areaId']}",
		"CITY_NAME" : "{$currArea['areaName']}",
		"DEFAULT_IMG": "{:WSTDomain()}/{$CONF['goodsImg']}",
		"MALL_NAME" : "{$CONF['mallName']}",
		"SMS_VERFY"  : "{$CONF['smsVerfy']}",
		"PHONE_VERFY"  : "{$CONF['phoneVerfy']}",
		"IS_LOGIN" :"{$WST_IS_LOGIN}",
		"WST_STYLE" :"{$WST_STYLE}"
	}




</script>
<script src="http://www.youyiku-yishu.cn/Public/js/think.js"></script>
<script>
	$('.regain_left').click(function(){
		window.history.back(-1)
	})
</script>
<script>
	function dump(){
		location.href = WST.U("WebApp/WxBooks/wxbook");
	}
</script>

</html>